<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script language="javascript">
	function showOrderDetail(id,orderid)
	{
		$.post("/orderlist/ajaxbutton", {"op": "showamazonsell","id":id},
		  function(data){
			  if(data.length==0)
			  {
				alert("没有数据！");
				return;  
				}else{
					var tmp='';				
					for(var i=0;i<data.length;i++)
					{
						tmp+='<tr>'
						tmp+="<td>"+data[i].productid+"</td><td>"+data[i].productname+"</td><td>"+data[i].ordernum+"</td><td>"+data[i].sellprice+"</td><td>"+data[i].shipprice+"</td><td>"+data[i].amount+"</td>";
						tmp+="</tr>";
						
					}
					 $("#showmabangid").html(tmp);
					 $("#sshowmabangorder").html(orderid);
					 $('#showmabangorder').modal('show');
				}
			 
		   },"json");
	}
</script>
<title>亚马逊导单日志</title>
<body class="withvernav">
<div class="bodywrapper">
{{include file='/public/leftmenu.tpl'}}
<div class="centercontent">
<div class="pageheader notab">
  <h1 class="pagetitle">亚马逊导单日志</h1>
  <span class="pagedesc"></span>
  <div class="menulist">
    <ul class="profile_summary">
       <li {{if $status==""}} class="current"{{/if}}> <a href="/factory/orderlist"><span>所有订单</span></a></li>
       <li {{if $status==1}} class="current"{{/if}}> <a href="/factory/orderlist?st=1"><span>那附近</span></a></li>
       <li {{if $status==2}} class="current"{{/if}}> <a href="/factory/orderlist?st=2"><span>生产中</span></a></li>
       <li {{if $status==3}} class="current"{{/if}}> <a href="/factory/orderlist?st=3"><span>生产完成</span></a></li>
       <li {{if $status==4}} class="current"{{/if}}> <a href="/factory/orderlist?st=4"><span>已发货</span></a></li>
       
        </ul>
  </div>
  
</div>
<!--pageheader-->
<div id="contentwrapper" class="contentwrapper">
<div id="basicform" class="subcontent">
   <!--搜索栏-->
          <div>
          
   	
         <div style="clear: both"></div>
         <div class="page">{{$pageList}} 计{{$total}}条记录，共{{$totalpage}}页</div>
   </div>
      
    <form class="stdform stdform2" method="get" id="search" action="/order/amazonorder">
    <input type='hidden' name='if_csv' id='if_csv'>
    <input type='hidden' name='csvlist' id='csvlist'>
    <input type='hidden' name='orderby' id='orderby'>

      <div class="tableoptions"> 
        <select name="shopname" id="shopname"  class="selection select2_group" style="width:150px;" >
        <option value="" >店铺</option>
        {{foreach from=$d_shop item=li key=key}}
              <option value="{{$li.name}}" {{if $shopname==$li.name}} selected{{/if}}>{{$li.name}}</option>
        {{/foreach}}
        </select>
      
          <select name="st" id="searchtype" class="selection " style="width:100px;" >
          <option value="" >配送方式</option>
        <option value="AFN" {{if $status=='AFN'}} selected{{/if}}>AFN</option>
        <option value="MFN" {{if $status=='MFN'}} selected{{/if}}>MFN</option>
  
      </select>        
               
       <select name="ty" id="searchtype" class="selection" style="width:100px;" >
        <option value="1" {{if $ty==1}} selected{{/if}}>订单时间</option>
      </select>
    
       <input type="text"  name="starttime" value="{{$starttime}} " onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" /> - <input type="text"  name="endtime" value="{{$endtime}} " onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" />
       订单号: <input type="text" name="other" id="other" class="width200" value="{{$other}}" placeholder="订单编号" />
       SKU: <input type="text" name="kw" id="kw" class="width200" value="{{$goodsku}}" placeholder="SKU" />
     
                           
&nbsp;
        <button class="btn btn-primary" id="searchbtn">Search</button>
     
      </div>
      
    
    </form>
    <!--搜索栏结束-->
<table cellpadding="0" cellspacing="0" border="0" class="stdtable" style="table-layout: fixed;">
<thead>
  <tr class="lbbt">
    <td width="5%"  bgcolor="#FEFFF1"><a onClick="allSelect('ppid[]')">全选</a></td>
    <td  bgcolor="#FEFFF1">订单编号</td>
    <td  bgcolor="#FEFFF1">导订备注</td>
    <td  bgcolor="#FEFFF1">状态</td>
    <td width="15%"  bgcolor="#FEFFF1">客户/国家</td>
    <td  bgcolor="#FEFFF1">货币</td>
    <td  bgcolor="#FEFFF1">平台/店铺/负责人</td>
    <td  bgcolor="#FEFFF1">配送方式</td>
    <td  bgcolor="#FEFFF1" >订单日期</td>

    
  </tr>
</thead>
<tbody >

{{foreach from=$orderlist item=li key=key}}
  <tr>
    <td bgcolor="#FFFFFF"><input name="ppid[]" type="checkbox" class="none" id="ppid[]" value="{{$li.orderId}}" /></td>
    <td valign="middle" bgcolor="#FFFFFF" style="position:relative;">
     <a href="javascript:void({{$li.id}})" onClick="showOrderDetail({{$li.id}},'{{$li.amzorderid}}')"><font color="#6666FF">{{$li.amzorderid}}</font></a>
     </td>
    <td valign="middle" bgcolor="#FFFFFF">{{$li.descr}}</td>
     <td valign="middle" bgcolor="#FFFFFF">{{$li.status}}</td>
    
    <td bgcolor="#FFFFFF" style="position:relative;">
   
      <div style="margin-left:2px;">  {{$li.custid}} 
     <font color="#6666FF">{{$li.custcountry}}</font>
    </div>
     
      <div class="lbcp">
      </div>
   </td>
    <td valign="middle" bgcolor="#FFFFFF">{{$li.origintotle}} ({{$li.moneytype}})</td>
    <td valign="middle" bgcolor="#FFFFFF">{{$li.shopname}} （{{$li.responsible}}）</td>
    <td bgcolor="#FFFFFF" class="cz">{{$li.fulfillmentchannel}}</td>
    <td bgcolor="#FFFFFF" class="cz">{{$li.ordercreatetime}}</td>
   
  
   
  </tr>
   
{{/foreach}}
</tbody>

</table>
  <div class="page">{{$pageList}} 计{{$total}}条记录，共{{$totalpage}}页</div>
</div>
</div>

  
  <!-- 模态框（Modal）显示马帮订单号 -->
  <form  method="post">
  <div class="modal fade" id="showmabangorder" tabindex="-1" role="dialog" aria-labelledby="sshowmabangorder" aria-hidden="true">
    <div class="modal-dialog" style="width:740px;">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" 
               aria-hidden="true">× </button>
          <h4 class="modal-title" id="sshowmabangorder"> 输入订单编号  </h4>
        </div>
        <div class="modal-body">
         <table cellpadding="0" cellspacing="0" border="0" class="stdtable" style="table-layout: fixed;">
          <tr class="lbbt"><td width="20%" bgcolor="#FEFFF1">商品编号</td><td bgcolor="#FEFFF1" width="40%">商品名称</td><td bgcolor="#FEFFF1">数量</td><td bgcolor="#FEFFF1">价格</td><td bgcolor="#FEFFF1">运费</td><td bgcolor="#FEFFF1">总价</td></tr>
          <tbody id="showmabangid"></tbody>
          </table>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" 
               data-dismiss="modal"> 关闭 </button>
          </div>
        </div>
        <!-- /.modal-content --> 
      </div>
      <!-- /.modal-dialog --> 
    </div>
  </div>
  <!-- /.modal -->
  </form>
</body>
</html>